$(function(){
	$('#ss').searchbox({
	    searcher:function(value){
			if(value == null || value == "" || typeof value == "undefined"){
				window.location.reload();
			}else{
				var a = document.createElement("a");
				a.href = "/filesharingsystem/search?keywords="+value;
				a.click();
			}
	    },
		border:false,
		width:'537',
		height:34,
	    prompt:'Please Input Value'
	});
	$(".nabla").mouseenter(function(){
		$("#info-panel").toggle();
	});
	$(".nabla").mouseout(function(){
		$("#info-panel").hide();
	});
	setCurrentUser();
})
function setCurrentUser(){
	$.get('user',function(data){
		$(".current-user-name").text(data.username);
		$(".level").text(data.role.roleName);

		
		$("#info1").html("用户名:"+data.username);
		$("#info2").html("邮&nbsp;&nbsp;&nbsp;箱:"+data.email);
		$("#info3").html("身&nbsp;&nbsp;&nbsp;份:"+data.role.roleName);
		$("#info4").html("状&nbsp;&nbsp;&nbsp;态:"+(data.state>0?"正常":"禁用"));
		$("#info5").html("注册于:"+data.regDate);
	},"json");	
}
